<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      header {
        width: 375px;
        background-color: red;
        height: 60px;
        color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 24px;
      }
    </style>
  </head>
  <body>
    <!-- 
      当一个组件需要多次调用的时候，
      显示的内容不一样
      不一样的内容都是从父组件传进来的
     -->
    <div id="app">
      <my-header title="猫眼电影"></my-header>
      <br />
      <my-header title="学爸"></my-header>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const MyHeader = {
        props: ["title"],
        template: `
          <header>{{ title }}</header>
        `,
      };

      Vue.createApp({
        data() {
          return {};
        },
        components: {
          MyHeader,
        },
      }).mount("#app");
    </script>
  </body>
</html>
